package com.chuangsi.project.admin.domain;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.TableName;

import javax.validation.constraints.*;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * <p>
 * 销售计划
 * </p>
 *
 * @author ywb
 * @since 2025-03-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_plan")
@ApiModel(value = "Plan对象", description = "销售计划")
public class Plan extends Model<Plan> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "计划id")
    @TableId(value = "plan_id", type = IdType.AUTO)
    @NotNull(message = "计划id不能为空")
    private Long planId;

    @ApiModelProperty(value = "部门id")
    @NotNull(message = "部门id不能为空")
    private Long deptId;

    @ApiModelProperty(value = "计划年份")
    @NotNull(message = "计划年份不能为空")
    private Integer year;

    @ApiModelProperty(value = "计划月份")
    @NotNull(message = "计划月份不能为空")
    private Integer month;

    @ApiModelProperty(value = "计划月份")
    @NotBlank(message = "计划月份不能为空")
    private String ym;

    @ApiModelProperty(value = "金额目标")
    @NotNull(message = "金额目标不能为空")
    private BigDecimal moneyGoal;

    @ApiModelProperty(value = "数量目标")
    @NotNull(message = "数量目标不能为空")
    private BigDecimal numGoal;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "创建时间不能为空")
    private LocalDateTime createTime;


    @Override
    protected Serializable pkVal() {
        return this.planId;
    }

}
